package com.woniuxy.cloud.procurementassembly.controller;


import com.woniuxy.cloud.demo.Result;
import com.woniuxy.cloud.procurementassembly.dto.BatteryOrderDto;
import com.woniuxy.cloud.procurementassembly.dto.BatteryOrderProcurementDetailsDto;
import com.woniuxy.cloud.procurementassembly.service.BatteryOrderProcurementDetailsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 周川雄
 * @since 2022-02-21
 */
@RestController
@RequestMapping("/battery-order-procurement-details")
public class BatteryOrderProcurementDetailsController {

    @Resource
    private BatteryOrderProcurementDetailsService service;

    @ApiOperation("发布采购订单")
    @PostMapping("/FindSaveBatteryOrderByOrderId.do")
    public Result<List<BatteryOrderProcurementDetailsDto>> FindProcurementDetailsByOrderId(@RequestBody Integer orderId) {

        List<BatteryOrderProcurementDetailsDto> dto = service.FindProcurementDetailsByOrderId(orderId);
        return Result.newInstance().setCode(200).setMsg("查询订单成功").setData(dto);


    }

}

